package com.epam.kozich.model;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;

public class Administrator extends Person {

	public Administrator(String login, String pass) {
		super(login, pass);
	}

	public Administrator() {
		new Administrator("null", "123");
	}

	public void addToBlackList(Person person) throws IOException {
		person.setInBlackList(false);
		
	}

	public void inFile() throws FileNotFoundException {

		File file = new File("BlackList.txt");
		Scanner sc = new Scanner(file);
		while (sc.hasNextLine()) {
			setLogin(sc.next());
			setPassword(sc.next());
			Person person = new Person(getLogin(), getPassword());
			person.setInBlackList(true);

		}
	}
}
